home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
comm
/
cnet
/
TrdWars23.lha
/
tw.uniconvert2.2
< prev
next >
Wrap
Text File
|
1993-07-14
|
1KB
|
74 lines
/* TradeWars Universe Conversion --- April 25, 1993
Converts 2.0x & 2.1x universe sector files to the new 2.2 format.
Run this once and ONLY ONCE! */
options results
signal on syntax
t=transmit;s=sendstring
dir="pfiles:tradewars/universe/"
dir2="pfiles:tradewars/ports/"
t "f1c3: TradeWars Universe Conversion Program for TW 2.2 :"
s "n2c6Workingc7"
sec=0
loop:
sec=sec+1;if sec>999 then signal endit
if ~exists(dir"tws"sec) then signal loop
call open(file,dir"tws"sec,"R")
do x=1 to 30
old.x = readln(file)
end
call close(file)
if left(old.21,1) ~="." & old.22 ~="0" then call makeport
do x=1 to 9
new.x = old.x
end
new.10 = old.16
new.11 = old.17
new.12 = old.21
new.13 = old.22
new.14 = old.24
new.15 = old.26
new.16 = old.27
new.17 = old.28
new.18 = old.29
new.19 = old.30
call open(file,dir"tws"sec,"W")
do x=1 to 19
call writeln(file,new.x)
end
call close(file)
s "."
signal loop
makeport:
po.1 = old.18
po.2 = old.23
po.3 = old.20
po.4 = old.19
po.5 = old.10
po.6 = old.11
po.7 = old.12
po.8 = old.13
po.9 = old.14
po.10 = old.15
po.11 = 0
call open(file,dir2"port."sec,"W")
do x=1 to 11
call writeln(file,po.x)
end
call close(file)
return
endit:
t "n2c2Conversion complete!!"
exit
syntax:
t "n1c1Syntax error!"
exit